var $ = getApp(), methods = require("../methods.js");
Page(Object.assign({}, methods, {
	data: {

	},
	_onLoad:function(){
		var that = this
		$.get('my/usercenter', {  }, function (data) {
			if (data.status == 1) {
				if(data.userinfo['nickname'] == '' || data.userinfo['nickname'] == '[暂无]'){ 
					that.getUserInfo();
				}else{
					that.setData({ needAuth:0,authCanClose:true})
				}
				var pagecontent = data.pagecontent
				var _bannerindex = [];
				for(var i in pagecontent){
					_bannerindex[i] = 0;
				}
				for (var i = 0; i < pagecontent.length; i++) {
					if (pagecontent[i].temp == 'userinfo') {
						pagecontent[i].data = {userinfo:data.userinfo,userlevel:data.userlevel,orderinfo:data.orderinfo,card_id:data.card_id};
					}
				}
				data.sysset.textset = that.data.textset
				console.log(data.sysset);
				that.setData({ sysset: data.sysset,pageinfo: data.pageinfo, pagecontent: pagecontent,_bannerindex:_bannerindex})
				wx.setNavigationBarTitle({ title: data.pageinfo.title })
			} else {
				$.alert(data.msg);
			}
		})
	}
}))